﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using FwProject.Distribution.Dto;
@using X.PagedList.Mvc.Common;
@model IPagedList<GenerateReceiptOutputDto>
@{
    Layout = null;
}
<div style="max-height:600px;overflow-y:scroll;">

    <table class="table table-bordered table-hover table-rowselected">
        <thead>
            <tr>
                <th>餐厅名称</th>
                <th>负责人</th>
                <th>电话</th>
                <th>收款周期</th>
                <th>金额</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.Count == 0)
            {
                <tr><td colspan="6" align="center">暂无未制作收据的餐厅</td></tr>
            }
            else
            {
                foreach (var item in Model)
                {
                    <tr>
                        <td>@item.RestaurantName</td>
                        <td>@item.Principal</td>
                        <td>@item.Mobile</td>
                        <td>@item.BalanceCycle</td>
                        <td>@item.Amount</td>
                    </tr>
                }
            }
        </tbody>
    </table>
</div>
<div class="row pagedinfo">
    <div class="col-sm-5">
        @*共 @Model.TotalItemCount 条，@Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页*@
        共 @Model.TotalItemCount 条，
        <select class="form-control" id="pageSize" style="width:70px;display:initial">
            @for (int z = 10; z < 100; z = z + 10)
            {
                if (z == Model.PageSize)
                {
                    <option selected value="@z">@z</option>
                }
                else
                {
                    <option value="@z">@z</option>
                }
            }
        </select> &nbsp;条/页 当前第 @Model.PageNumber/@Model.PageCount 页
    </div>
    <div class="col-sm-7">
        <input type="hidden" id="pageurl" value="&keyword=@(Context.Request.Query["keyword"])&beginTime=@(Context.Request.Query["beginTime"])&endTime=@(Context.Request.Query["endTime"])&driverId=@(Context.Request.Query["driverId"])" />
        @Html.PagedListPager(Model, page => Url.Action("NotMadeReceipt", new { pageIdx = page, size = Context.Request.Query["size"], keyword = Context.Request.Query["keyword"], beginTime = Context.Request.Query["beginTime"], endTime = Context.Request.Query["endTime"], driverId = Context.Request.Query["driverId"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "LoadDataSuccessMessage", OnBegin = "AjaxBegin" }))
    </div>
</div>

